package com.hyt.it.ogt.ykcj.service.grade.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hyt.it.ogt.ykcj.common.utils.DateUtils;
import com.hyt.it.ogt.ykcj.domain.grade.ServantPassAnalysisData;
import com.hyt.it.ogt.ykcj.mapper.grade.ServantPassAnalysisDataMapper;
import com.hyt.it.ogt.ykcj.service.grade.IServantPassAnalysisDataService;

/**
 * 公务员考试合格及通过分析Service业务层处理
 *
 * @author admin
 * @date 2021-10-13
 */
@Service
public class ServantPassAnalysisDataServiceImpl implements IServantPassAnalysisDataService {

  @Autowired
  private ServantPassAnalysisDataMapper servantPassAnalysisDataMapper;

  /**
   * 查询公务员考试合格及通过分析
   *
   * @param id 公务员考试合格及通过分析ID
   * @return 公务员考试合格及通过分析
   */
  @Override
  public ServantPassAnalysisData selectServantPassAnalysisDataById(String id) {
    return servantPassAnalysisDataMapper.selectServantPassAnalysisDataById(id);
  }

  /**
   * 查询公务员考试合格及通过分析列表
   *
   * @param servantPassAnalysisData 公务员考试合格及通过分析
   * @return 公务员考试合格及通过分析
   */
  @Override
  public List<ServantPassAnalysisData> selectServantPassAnalysisDataList(
      ServantPassAnalysisData servantPassAnalysisData) {
    return servantPassAnalysisDataMapper.selectServantPassAnalysisDataList(servantPassAnalysisData);
  }

  /**
   * 新增公务员考试合格及通过分析
   *
   * @param servantPassAnalysisData 公务员考试合格及通过分析
   * @return 结果
   */
  @Override
  public int insertServantPassAnalysisData(ServantPassAnalysisData servantPassAnalysisData) {
    servantPassAnalysisData.setCreateTime(DateUtils.getNowDate());
    return servantPassAnalysisDataMapper.insertServantPassAnalysisData(servantPassAnalysisData);
  }

  /**
   * 修改公务员考试合格及通过分析
   *
   * @param servantPassAnalysisData 公务员考试合格及通过分析
   * @return 结果
   */
  @Override
  public int updateServantPassAnalysisData(ServantPassAnalysisData servantPassAnalysisData) {
    servantPassAnalysisData.setUpdateTime(DateUtils.getNowDate());
    return servantPassAnalysisDataMapper.updateServantPassAnalysisData(servantPassAnalysisData);
  }

  /**
   * 批量删除公务员考试合格及通过分析
   *
   * @param ids 需要删除的公务员考试合格及通过分析ID
   * @return 结果
   */
  @Override
  public int deleteServantPassAnalysisDataByIds(String[] ids) {
    return servantPassAnalysisDataMapper.deleteServantPassAnalysisDataByIds(ids);
  }

  /**
   * 删除公务员考试合格及通过分析信息
   *
   * @param id 公务员考试合格及通过分析ID
   * @return 结果
   */
  @Override
  public int deleteServantPassAnalysisDataById(String id) {
    return servantPassAnalysisDataMapper.deleteServantPassAnalysisDataById(id);
  }
}
